﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using DLV.Utilities;

namespace DLV.Data.Entities
{
    public class ViandController
    {
        public int InsertViand(ViandInfo info)
        {
            return SQL.InsertViand(info.ViandName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void UpdateViand(ViandInfo info)
        {
            SQL.UpdateViand(info.ViandId, info.ViandName, info.CreatedBy, info.CreatedDate, info.UpdatedBy, info.UpdatedDate, info.Status);
        }
        public void DeleteViand(ViandInfo info)
        {
            DeleteViand(info.ViandId);
        }
        public void DeleteViand(int viandId)
        {
            SQL.DeleteViand(viandId);
        }
        public ViandInfo GetViand(int viandId)
        {
            return CBO.FillObject<ViandInfo>(SQL.GetViand(viandId));
        }
        public List<ViandInfo> ListViand()
        {
            return CBO.FillCollection<ViandInfo>(SQL.ListViand());
        }
        public DataTable SelectViand()
        {
            return CBO.ConvertToDataTable(ListViand(), typeof(ViandInfo));
        }

        public List<ViandInfo> ListViandById(string viandIds)
        {
            return CBO.FillCollection<ViandInfo>(SQL.ListViandById(viandIds));
        }
    }
}
